﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HospitalSystem.Core;


namespace HospitalSystem
{
    public partial class educationinfo : System.Web.UI.Page
    {
        private show_Image _showimage;
        private regfamilyLog _regf;
        private RegisterLog _RL;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["CID"] == null)
            {

                MessageBoxurl("กรุณากดค้นหา หรือลงทะเบียนเด็กก่อน", "findchild.aspx");

            }
            else
            {

                _showimage = new show_Image();
                _regf = new regfamilyLog();
                _RL = new RegisterLog();

                showsession();
                _showimage.show_Images(cid_label, Image1);




                if (!IsPostBack)
                {

                    _RL.BindDatareg_educationnfoshow(GridView1, cid_label);
                    _RL.loaddataeducationinfoshow(cid_label, Schooll, levell, typel, Personnell, phonel);

                }

            }



        }

      
          
        private void MessageBoxurl(string msg, string urld)
        {
            Label lbl = new Label();
            lbl.Text = "<script language='javascript'>" + Environment.NewLine + "window.alert('" + msg + "');" + "window.location.href='" + urld + "';" + "</script>";
            Page.Controls.Add(lbl);
        }
        protected void showsession()
        {
            String ShowValue = (string)Session["CID"];
            cid_label.Text = ShowValue;
            String ShowValue2 = (string)Session["LastName"];
            lname.Text = ShowValue2;

            String ShowValue3 = (string)Session["FirstName"];
            fname.Text = ShowValue3;



        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("education.aspx");

        }

        private void MessageBox(string msg)
        {
            Label lbl = new Label();
            lbl.Text = "<script language='javascript'>" + Environment.NewLine + "window.alert('" + msg + "')</script>";
            Page.Controls.Add(lbl);
        }


    }
}